package com.petmarket.common;

import com.petmarket.contract.LoginContract;
import org.fisco.bcos.sdk.v3.transaction.model.exception.ContractException;

import java.math.BigInteger;
import java.util.UUID;

public class LogId {

    public static BigInteger getId() throws ContractException {
        LoginContract loginContract = (LoginContract) CommonClient.getContractMap("LoginDetails");
        BigInteger count = loginContract.count(BigInteger.valueOf(0), BigInteger.valueOf(200)).add(BigInteger.valueOf(1));

        return count;
    }

    public static String usingUUID() {
        UUID randomUUID = UUID.randomUUID();
        return randomUUID.toString().replaceAll("-", "");
    }

}
